<html>
  <head>
  <title>siblinker: find deliciously related links</title>
<style type="text/css">
/* <![CDATA[ */
body form input {
 font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
}
body {
 margin-left: 10em;
 margin-right: 10em;
}
h1, h2, h3, h4 {
 font-family: Garamond, "Century Schoolbook L", serif;
}
#head {
    text-align: center;
}
ul, li {
 margin-left: 2em;
}
div.description {
 color: gray;
 margin-left: 2em;
 margin-right: 2em;
}
div.tags {
 margin-left: 1em;
 margin-right: 1em;
}

/* ]]> */
</style>
  </head>
  <body>
  <div id="head">
  <h1>siblinker<br>find <em><a href="http://delicious.com">delicious</a></em>ly related links<br>(<a href="http://siblinker.googlecode.com">code</a>)</h1>
  </div>
  
    <h2>Query</h2>
    <form method="get">
      <div><input name="url" value="{% if queryUrl %}{{ queryUrl.url }}{% else %}http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf{% endif %}" size="100"></div>
      <div><input type="submit" value="Find Similar URLs"></div>
    </form>

    {% if queryUrl %}
    <h2>Results</h2>
    {% if queryUrl.sibUrls %}
    {% for x in queryUrl.users %}
    ( <em><a href="http://delicious.com/{{ x.user }}/">{{ x.user }}</a></em>:
    {% for tag in x.tags %}
    <a href="http://delicious.com/{{ x.user }}/{{ tag }}">{{ tag }}</a>
    {% endfor %}
    )
    {% endfor %}
    <ul>
    {% for sibUrl in queryUrl.sibUrls %}
      <li>
      ({{ sibUrl.nUsers}}) <a href="{{ sibUrl.url }}">{{ sibUrl.titleCloud.best }}</a>

      <div class="tags">
      {% for tag in sibUrl.tagCloud.keys %}
      <a href="http://delicious.com/popular/{{tag}}">[</a>{{ tag }}<a href="http://delicious.com/tag/{{tag}}">]</a>
      {% endfor %}
      </div>

      {% if sibUrl.descriptionCloud.best %}
      <div class="description">
      {{ sibUrl.descriptionCloud.best }}
      </div>
      {% endif %}
      </li>
    {% endfor %}
    </ul>
    {% else %}
    <em>No results, because the given link is either too popular or unpopular.</em>
    {% endif %}
    {% endif %}
  </body>
</html>
